﻿import Bxo.TestingPortal.WebApplication
import Bxo.TestingPortal.WebApplication.Controllers
import Castle.Facilities.Logging
import Castle.MicroKernel
import Castle.Services.Transaction
import Castle.MonoRail.WindsorExtension
import Rhino.Commons
import Rhino.Commons from Rhino.Commons.ActiveRecord
import System.Reflection


#
# Facilities
#

facility LoggingFacility:
	loggingApi =  LoggerImplementation.Log4net
	configFile = "log4net.xml"
facility MonoRailFacility
facility RhinoTransactionFacility

#
# Persistence
#

activeRecordAssemblies = ( Assembly.Load("Bxo.TestingPortal.Entities"), )

component IRepository, ARRepository

component IUnitOfWorkFactory, ActiveRecordUnitOfWorkFactory:
    assemblies = activeRecordAssemblies
	
#
# Controllers
#

for type in AllTypes("Bxo.TestingPortal.WebApplication").Where({ t as System.Type | t.Name.Contains("Controller") }):
	component type
